package com.cckat.service.impl;

import com.cckat.base.BaseMapper;
import com.cckat.base.BaseServiceImpl;
import com.cckat.entity.Community;
import com.cckat.mapper.CommunityMapper;
import com.cckat.mapper.DictMapper;
import com.cckat.service.CommunityService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author 静海基地
 */
@DubboService
public class CommunityServiceImpl extends BaseServiceImpl<Community> implements CommunityService {

    @Autowired
    private CommunityMapper communityMapper;

    @Autowired
    private DictMapper dictMapper;


    @Override
    public BaseMapper<Community> getBaseMapper() {
        return communityMapper;
    }


//    ??????????????????????????????????
    @Override
    public Community getById(Long id) {
        Community community = communityMapper.getById(id);
        community.setAreaName(dictMapper.findNameById(community.getAreaId()));
        community.setPlateName(dictMapper.findNameById(community.getPlateId()));
        return community;
    }

}
